package com.bw.z.mvp.model.entity;

import com.google.gson.Gson;

import org.json.JSONArray;
import org.json.JSONException;

import java.util.ArrayList;
import java.util.List;

public class ChannelEntity extends BaseEntity {
    public String values;

    public List<Values> getValues() {
        if (values == null)
            return null;
        List<Values> list = new ArrayList<>();
        try {
            JSONArray jsonArray = new JSONArray(values);
            for (int i = 0; i < jsonArray.length(); i++) {
                String str = jsonArray.getString(i);
                Values entity = new Gson().fromJson(str, Values.class);
                list.add(entity);
            }
        } catch (JSONException e) {
            e.printStackTrace();
        }
        return list;
    }

    public static class Values {
        public String channel_name;
        public long channel_id;
        public int channel_hot;
        public boolean dragEnable = true;
        public boolean dropEnable = true;

        public boolean isDragEnable() {
            return dragEnable;
        }

        public void setDragEnable(boolean dragEnable) {
            this.dragEnable = dragEnable;
        }

        public boolean isDropEnable() {
            return dropEnable;
        }

        public void setDropEnable(boolean dropEnable) {
            this.dropEnable = dropEnable;
        }
    }
}
